package com.ithema.b2b.userconsumer.service;

import com.ithema.b2b.userconsumer.hystrix.UserServiceHystrix;
import model.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(value = "b2b-user-provider", fallback = UserServiceHystrix.class)
public interface UserService {
    @GetMapping(value = "/login")
    public User login(@RequestParam(value = "uaccount") String uaccount);

    @GetMapping(value = "/register")
    public int register(@RequestParam(value = "uname") String uname,
                        @RequestParam(value = "usex") String usex,
                        @RequestParam(value = "upassword") String upassword);
}
